define(['jquery', 'bootstrap', 'frontend', 'template', 'form'], function ($, undefined, Frontend, Template, Form) {
    var validatoroptions = {
        invalid: function (form, errors) {
            $.each(errors, function (i, j) {
                Layer.msg(j);
            });
        }
    };
	var Controller = {
        luzhi:function () {
            //本地验证未通过时提示
            $("#video-form").data("validator-options", validatoroptions);
			//为表单绑定事件
            Form.api.bindevent($("#video-form"), function (data, ret) {
                setTimeout(function () {
                    location.href = ret.url ? ret.url : "/";
                }, 1000);
            });
        },
		videolist:function(){
			require(['bootstrap-datetimepicker'], function () {
				var options = {
					format: 'YYYY-MM-DD',
					icons: {
						time: 'fa fa-clock-o',
						date: 'fa fa-calendar',
						up: 'fa fa-chevron-up',
						down: 'fa fa-chevron-down',
						previous: 'fa fa-chevron-left',
						next: 'fa fa-chevron-right',
						today: 'fa fa-history',
						clear: 'fa fa-trash',
						close: 'fa fa-remove'
					},
					showTodayButton: true,
					showClose: true
				};
				$('.datetimepicker').parent().css('position', 'relative');
				$('.datetimepicker').datetimepicker(options).on('dp.change', function (e) {
					$(this, document).trigger("changed");
				});
			});
		}
    };
    return Controller;
});
